<template>
	<div class="page healthImprove">
		<x-header class='header' slot="header" :left-options="{backText: ''}">医疗建议</x-header>
		<div class="top" style="height: 50px; width: 100%;"></div>
		<view-box>
			<div class="west">
				<div class="westmedical">西药管理及药物禁忌指导</div>
				<group v-for="item in western_medicine">
					<cell title="药物名称" :value="item.westernMedicineName"></cell>
					<cell title="用药时间" :value="item.westernMedicineTime"></cell>
					<cell title="用法用量" :value="item.westernMedicineDose"></cell>
					<cell :title="item.westernMedicineNote " value="" style='padding: 4px 15px 15px;font-size: 14px; color: rgb(51,51,51);'></cell>
				</group>
			</div>
			<div class="ch">
				<div class="westmedical">中药管理及药物禁忌指导</div>
				<group v-for="item in chinese_medicine">
					<cell title="药物名称" :value="item.chineseMedicineName"></cell>
					<cell title="辩       证" :value="item.chineseMedicineCertificate"></cell>
					<cell title="治       法" :value="item.chineseMedicineSolution"></cell>
					<cell title="用法用量" :value="item.chineseMedicineUsage"></cell>
					<cell :title="'组成:　' + item.chineseMedicineComposition" value="" style='padding: 4px 15px 10px;font-size: 14px; color: rgb(51,51,51);'>
					</cell>
				</group>
			</div>
		</view-box>

	</div>
</template>

<script>
	import Api from '@/api/index.js' //  引入api文件
	export default {
		data(){
			return {
				customer_id: '',
				western_medicine: [],
				chinese_medicine: []
			}
		},
		created(){
			this.customer_id = localStorage.getItem('customer_id');
			this.getData();
		},
		methods: {
			getData(){
				const western_medicineApi = Api.western_medicineApi + this.customer_id;   //  西药  API
				const chinese_medicineApi = Api.chinese_medicineApi + this.customer_id;   // 中药
				this.$http.get(western_medicineApi)
				.then(({data})=>{
					console.log(data)
					this.western_medicine = data.data;
				})
				this.$http.get(chinese_medicineApi)
				.then(({data})=>{
					this.chinese_medicine = data.data;
					console.log(data.data)
				})
			}
		}
	}
	
</script>

<style lang="less" scoped>
	.healthImprove {
		position: fixed !important;
		left: 0;
		top: 0;
		right: 0;
		background: #fff;
		z-index: 999;
		width: 100%;
		height: 100%;
		overflow: hidden;
		.westmedical {
			background-color: rgb(243, 243, 243);
			text-align: center;
			height: 30px;
			font-size: 16px;
			line-height: 30px;
		}
	}
</style>